
from flasgger import Swagger

def swagger_ui_from_app(app):
    app.config['SWAGGER'] = {
        'title': 'Your API Title',
        'version': '1.0',
        'openapi': '3.0.2',  # 明确指定为Swagger 3.0.0版本
        'description': 'A description of your API'
    }
    swagger = Swagger(app)
    return swagger